package controller

import (
	"Free-Wind/common"
	"Free-Wind/domain"
	"github.com/gin-gonic/gin"
)

type UsersController struct{}

func (s UsersController) GetById(c *gin.Context) {
	id := c.Param("id")
	common.ReturnOK(c, 200, "操作成功", id)
}

func (s UsersController) Add(c *gin.Context) {
	userBo := &domain.UserBo{}
	err := c.BindJSON(&userBo)
	if err == nil {
		common.ReturnOK(c, 200, "操作成功", userBo.Name)
		return
	}
	common.ReturnError(c, 500, "操作成功")
}
